package com.kmxd.ams.client.logs.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 档案维护日志表
 *
 * @author ZuoLG
 * @since 2022-09-06
 */
@Data
@ColumnWidth(15)
@HeadRowHeight(15)
@ContentRowHeight(15)
@HeadStyle
@HeadFontStyle(fontHeightInPoints = 12)
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.CENTER)
@ContentFontStyle(fontHeightInPoints = 10)
@ExcelIgnoreUnannotated
@Schema(description = "档案维护日志表对象")
public class LogArchiveListVO implements Serializable {

  private static final long serialVersionUID = 1L;

  @Schema(description = "主键ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "主键ID")
  private Long id;

  @Schema(description = "公司ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "公司ID")
  private Long comId;

  @Schema(description = "全宗ID")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "全宗ID")
  private Long fondsId;

  @Schema(description = "部门ID")
  @ExcelProperty(value = "部门ID")
  private Long deptId;

  @Schema(description = "部门名称")
  @ExcelProperty(value = "部门名称")
  private String deptName;

  @Schema(description = "角色id")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "角色id")
  private Long roleId;

  @Schema(description = "操作人IP地址")
  @ExcelProperty(value = "操作人IP地址")
  private String ip;

  /** 用户id */
  @Schema(description = "用户id")
  @ExcelProperty(value = "用户id")
  private Long userId;

  @Schema(description = "操作人代码")
  @ExcelProperty(value = "操作人代码")
  private String userCode;

  @Schema(description = "操作人名称")
  @ExcelProperty(value = "操作人名称")
  private String userName;

  @Schema(description = "档案主键")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "档案主键")
  private Long archId;

  @Schema(description = "表名称。用于可能的关联")
  @ExcelProperty(value = "表名称。用于可能的关联")
  private String tableId;

  @Schema(description = "档案类型")
  @JsonSerialize(using = ToStringSerializer.class)
  @ExcelProperty(value = "档案类型")
  private Long archTypeId;

  @Schema(description = "档案类型名称")
  @ExcelProperty(value = "档案类型名称")
  private String archTypeName;

  @Schema(description = "文书、案卷、项目")
  @ExcelProperty(value = "文书、案卷、项目")
  private String archLevel;

  @Schema(description = "年度")
  @ExcelProperty(value = "年度")
  private String year;

  @Schema(description = "密级")
  @ExcelProperty(value = "密级")
  private String security;

  @Schema(description = "档号")
  @ExcelProperty(value = "档号")
  private String archCode;

  @Schema(description = "题名")
  @ExcelProperty(value = "题名")
  private String archTitle;

  @Schema(description = "保管期限")
  @ExcelProperty(value = "保管期限")
  private String retentionPeriod;

  @Schema(description = "特殊的，例如推送时写名字，编研时写编研标题等")
  @ExcelProperty(value = "特殊的，例如推送时写名字，编研时写编研标题等")
  private String special;

  @Schema(description = "操作计数")
  @ExcelProperty(value = "操作计数")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer opCount;

  @Schema(description = "操作控制器")
  @ExcelProperty(value = "操作控制器")
  private String controller;

  @Schema(description = "操作函数")
  @ExcelProperty(value = "操作函数")
  private String action;

  @Schema(description = "操作类型 1 维护,2 使用,3 利用")
  @ExcelProperty(value = "操作类型 1 维护,2 使用,3 利用")
  private Integer type;

  @Schema(description = "操作名称")
  @ExcelProperty(value = "操作名称")
  private String typeName;

  @Schema(description = "业务状态：历史行为 或 计划任务")
  @ExcelProperty(value = "业务状态：历史行为 或 计划任务")
  private String businessStatus;

  @Schema(description = "行为依据，记录档案业务行为的背景信息，维护电子文件的合法性、真实性")
  @ExcelProperty(value = "行为依据，记录档案业务行为的背景信息，维护电子文件的合法性、真实性")
  private String actionMandate;

  @Schema(description = "行为描述，记录档案行为的前后状态，业务活动过程、方法等")
  @ExcelProperty(value = "行为描述，记录档案行为的前后状态，业务活动过程、方法等")
  private String actionDescription;

  @Schema(description = "档案库类型名称")
  @ExcelProperty(value = "档案库类型名称")
  private String archivesName;

  @Schema(description = "维护类型")
  private Integer opType;

  @Schema(description = "维护名称")
  private String opTypeName;

  @Schema(description = "业务行为")
  private Integer op;

  @Schema(description = "业务名称")
  private String opName;

  @Schema(description = "维护类型")
  @ExcelProperty(value = "维护类型")
  private String maintainType;

  @Schema(description = "是否是在线接收记录 1在线接收，其他不是")
  @ExcelProperty(value = "是否是在线接收记录 1在线接收，其他不是")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer isOnline;

  @Schema(description = "归档、未归档（区分整编库和归档库）")
  @ExcelProperty(value = "归档、未归档（区分整编库和归档库）")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer status;

  @Schema(description = "日志安全等级：0低，1中，2高，3高危")
  @ExcelProperty(value = "日志安全等级：0低，1中，2高，3高危")
  @JsonSerialize(using = ToStringSerializer.class)
  private Integer level;

  @Schema(description = "操作时间")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @ColumnWidth(20)
  @ExcelProperty(value = "操作时间")
  private Date opTime;
}
